package com.mojavelinux.open18;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import org.hibernate.validator.NotNull;

public class Score implements Serializable {

	private static final long serialVersionUID = 1L;

	private long id;
	
	private Round round;
	
	private Hole hole;
	
	private int strokes;
	
	private boolean fairway;
	
	private boolean greenInRegulation;
	
	private int putts;

	public Score() {}
	
	@Id
	@GeneratedValue( strategy = GenerationType.AUTO )
	@Column( name = "id", updatable = false )
	public long getId() {
		return id;
	}

	public void setId( long id ) {
		this.id = id;
	}

	@Column( name="fairway" )
	public boolean isFairway() {
		return fairway;
	}

	public void setFairway( boolean fairway ) {
		this.fairway = fairway;
	}

	@Column( name="green_in_regulation" )
	public boolean isGreenInRegulation() {
		return greenInRegulation;
	}

	public void setGreenInRegulation( boolean greenInRegulation ) {
		this.greenInRegulation = greenInRegulation;
	}

	@ManyToOne( optional = false )
	@NotNull
	public Hole getHole() {
		return hole;
	}

	public void setHole( Hole hole ) {
		this.hole = hole;
	}

	@Column( name="putts" )
	public int getPutts() {
		return putts;
	}

	public void setPutts( int putts ) {
		this.putts = putts;
	}

	@ManyToOne( optional = false )
	@NotNull
	public Round getRound() {
		return round;
	}

	public void setRound( Round round ) {
		this.round = round;
	}

	@Column( name="strokes" )
	public int getStrokes() {
		return strokes;
	}

	public void setStrokes( int strokes ) {
		this.strokes = strokes;
	}
	
}
